class Car {
    constructor(brand) {
      this.brand = brand;
    }
    getDetails() {
      return `Car brand: ${this.brand}`;
    }
  }
  
  class CarFactory {
    static createCar(brand) {
      return new Car(brand);
    }
  }
  
  // 测试
  const car1 = CarFactory.createCar("Toyota");
  const car2 = CarFactory.createCar("Honda");
  console.log(car1.getDetails()); // "Car brand: Toyota"
  console.log(car2.getDetails()); // "Car brand: Honda"